package com.example.online.music.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.online.music.common.R;
import com.example.online.music.model.domain.Song;
import com.example.online.music.model.request.SongRequest;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface SongService extends IService<Song> {

    R addSong (SongRequest addSongRequest,  MultipartFile mpfile);

    R updateSongMsg(SongRequest updateSongRequest);

    R updateSongUrl(MultipartFile urlFile, int id);

    R updateSongPic(MultipartFile urlFile, int id);

    R deleteSong(Integer id);

    R allSong();

    R songOfSingerId(Integer singerId);

    R songOfId(Integer id);

    R songOfSingerName(String name);

    List<Integer> getAllSongIds();

    /**
     * @Description: 根据用户id获取该用户的推荐歌曲列表
     * @CreateTime:
     * @param: userId
     * @return: com.example.online.music.common.R
     **/
    R getRecommendSongList(Integer userId);
    /**
     * 判断歌曲是否支付
     * @param songId
     * @param userId
     * @return true 已购买歌曲
     */
    R isPay(Integer songId, Integer userId);

    /**
     * 后台下载歌曲
     * @param id
     * @param userId
     * @param response
     * @throws Exception
     */
    R downloadSong(Integer id, Integer userId, HttpServletResponse response) throws Exception;
}
